home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: ***NEED HELP WITH CALCULATION FUNCTION*** ASAP
- Date: 16 Mar 1996 19:03:07 GMT
- Organization: Nando.net Public Access
- Message-ID: <4if39b$d2h@castle.nando.net>
- References: <4i0mva$j0c@fountain.mindlink.net>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail1814.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <4i0mva$j0c@fountain.mindlink.net>, mike_huwe@mindlink.bc.ca (Mike Huwe) writes:
- >I need to write a function called calc_investment() based on the following
- >formula: P = F/(1+r)^n
- >
- >where P : is the value to invest
- > F : is the future amount needed
- > r : is the annual rate of interest
- > n : is the length of the period
- > ^ : power of
- >
- >The user is allowed to enter the annual rate of interest either as a
- >percentage eg. 15 or enter as a decimal eg. .15. If the user enters the
- >annual rate of interest as a percentage eg. 15, then divide by 100
- >before using it in the formula.
- >
- >Any ideas how I could code this test?
-
- Your description doesn't make any sence. One user may type 15
- meaning 15%, another might intend 1500%. Likewise .15 may be
- a fractional representation of 15% of a percentage representation
- of 15 basis points.
-
- BTW, does any of this have anything to do with C?
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-